﻿
@{
    ViewBag.Title = "ProductList";
    Layout = "/Views/Shared/_Head.cshtml";
}
<script src="~/Scripts/jquery.url.js"></script>
<script src="~/Scripts/comm.js"></script>
<script>
    
    var TopProduct = jQuery.url.param("TopProduct");
    var ClinchProduct = jQuery.url.param("ClinchProduct");
    $(function () {
        var html = '<a href="/home/index">首页</a>';
        if (TopProduct) {
            html += '<span>&gt;</span><a href="/Product/ProductList?TopProduct=1">藏品会员展示区</a>';
        }
        if (ClinchProduct) {
            html += '<span>&gt;</span><a href="/Product/ProductList?ClinchProduct=1">藏品成交区</a>';
        }
        $('#BreadCrumbs').html(html);
        loadlist();
    })
    function loadlist() {
        layui.use('laytpl', function () {
            var laytpl = layui.laytpl;
            $("#productPage").html("");
            $.post('/Product/ProducrWhere?pageIndex=' + pageIndex, function (data) {
                if (data.success) {
                    totalPage = data.totalPage;
                    page();
                    var getTpl = $('#productList').html();
                    $.each(data.result, function (i, r) {
                        r.Index = i + 1;
                        laytpl(getTpl).render(r, function (html) {
                            $('#productPage').append(html);
                        });
                    })
                }
            })
        });
    }
</script>
<script type="text/template" id="productList">
    <li>
        <a href="/Product/ProductInfo?ID={{d.ProductID}}">
            <img src="{{d.Image}}"><span>{{d.Title}}</span>
            <p>{{d.Money}}</p>
        </a>
    </li>
</script>
<div class="container">
    <!---->
    <div class="page" id="BreadCrumbs"></div>
    <section>
        <ul class="clearfix indexBox indexBox_list" id="productPage"></ul>
        <div class="clearfix mar_tb">
            <div id="page" class="fr"></div>
        </div>
    </section>
</div>
